package com.example.util;

/**
 * A map path node.
 * When a unit intersects a path node its determines a new direction for
 * the unit in order to reach its final destination.
 * @authors Itay Sorani, Nadav Ziv, Yonathan Zarsky
 */
public class PathNode {
	
	// the path node position
	private float xPosition, yPosition;
	// the path node id
	private int pathNodeId;
	// determines the units of which player should be directed using this path node.
	private int pathNodeDirectedPlayer;
	
	/**
	 * Constructs a new map cell according to its position.
	 */
	public PathNode(float x, float y) {
		this.xPosition = x;
		this.yPosition = y;
	}
	
	/**
	 * Constructs a new map cell according to its position, and the player id of the 
	 * desired directed units.
	 */
	public PathNode(float x, float y, int directedPlayer) {
		this.xPosition = x;
		this.yPosition = y;
		this.pathNodeDirectedPlayer = directedPlayer;
	}

	/**
     * sets the path nodes x position.
     */
	public void setX(float xPosition) {
		this.xPosition = xPosition;
	}

	/**
     * returns the path nodes x position.
     */
	public float getX() {
		return xPosition;
	}

	/**
     * sets the path nodes y position.
     */
	public void setY(float yPosition) {
		this.yPosition = yPosition;
	}

	/**
     * returns the path nodes y position.
     */
	public float getY() {
		return yPosition;
	}

	/**
     * sets the path nodes id
     */
	public void setPathNodeId(int pathNodeId) {
		this.pathNodeId = pathNodeId;
	}

	/**
     * returns the path nodes id
     */
	public int getPathNodeId() {
		return pathNodeId;
	}
	
	/**
     * sets the path nodes position
     */
	public Vec2D getPosition () {
		return (new Vec2D(this.xPosition,this.yPosition));
	}

	/**
     * sets the path nodes player id of the 
	 * desired directed units.
     */
	public void setPathNodeDirectedPlayer(int pathNodeDirectedPlayer) {
		this.pathNodeDirectedPlayer = pathNodeDirectedPlayer;
	}

	/**
     * returns the path nodes player id of the 
	 * desired directed units.
     */
	public int getPathNodeDirectedPlayer() {
		return pathNodeDirectedPlayer;
	}
}
